<a href='https://github.com/angular/angular.js/edit/v1.6.x/src/Angular.js?message=docs(angular.merge)%3A%20describe%20your%20change...#L426' class='improve-docs btn btn-primary'><i class="glyphicon glyphicon-edit">&nbsp;</i>Improve this Doc</a>



<a href='https://github.com/angular/angular.js/tree/v1.6.6/src/Angular.js#L426' class='view-source pull-right btn btn-primary'>
  <i class="glyphicon glyphicon-zoom-in">&nbsp;</i>View Source
</a>


<header class="api-profile-header">
  <h1 class="api-profile-header-heading">angular.merge</h1>
  <ol class="api-profile-header-structure naked-list step-list">
    
    <li>
      - function in module <a href="api/ng">ng</a>
    </li>
  </ol>
</header>



<div class="alert alert-danger deprecation">
  <div class="title"><strong>Deprecated:</strong>
    <span class="since">(since 1.6.5) </span>
    
  </div>
  <p>This function is deprecated, but will not be removed in the 1.x lifecycle.
There are edge cases (see <a href="api/ng/function/angular.merge#known-issues">known issues</a>) that are not
supported by this function. We suggest
using <a href="https://lodash.com/docs/4.17.4#merge">lodash&#39;s merge()</a> instead.</p>

</div>



<div class="api-profile-description">
  <p>Deeply extends the destination object <code>dst</code> by copying own enumerable properties from the <code>src</code> object(s)
to <code>dst</code>. You can specify multiple <code>src</code> objects. If you want to preserve original objects, you can do so
by passing an empty object as the target: <code>var object = angular.merge({}, object1, object2)</code>.</p>
<p>Unlike <a href="api/ng/function/angular.extend">extend()</a>, <code>merge()</code> recursively descends into object properties of source
objects, performing a deep copy.</p>

</div>



<h2 id="known-issues">Known Issues</h2>
<div class="known-issue">
  <p>This is a list of (known) object types that are not handled correctly by this function:</p>
<ul>
<li><a href="https://developer.mozilla.org/docs/Web/API/Blob"><code>Blob</code></a></li>
<li><a href="https://developer.mozilla.org/docs/Web/API/MediaStream"><code>MediaStream</code></a></li>
<li><a href="https://developer.mozilla.org/docs/Web/API/CanvasGradient"><code>CanvasGradient</code></a></li>
<li>AngularJS <a href="api/ng/type/$rootScope.Scope">scopes</a>;</li>
</ul>

</div>


<div>
  

  

  <h2 id="usage">Usage</h2>
    
      <p><code>angular.merge(dst, src);</code></p>


    

    
<section class="api-section">
  <h3>Arguments</h3>

<table class="variables-matrix input-arguments">
  <thead>
    <tr>
      <th>Param</th>
      <th>Type</th>
      <th>Details</th>
    </tr>
  </thead>
  <tbody>
    
    <tr>
      <td>
        dst
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-object">Object</a>
      </td>
      <td>
        <p>Destination object.</p>

        
      </td>
    </tr>
    
    <tr>
      <td>
        src
        
        
      </td>
      <td>
        <a href="" class="label type-hint type-hint-object">Object</a>
      </td>
      <td>
        <p>Source object(s).</p>

        
      </td>
    </tr>
    
  </tbody>
</table>

</section>
    
    <h3>Returns</h3>
<table class="variables-matrix return-arguments">
  <tr>
    <td><a href="" class="label type-hint type-hint-object">Object</a></td>
    <td><p>Reference to <code>dst</code>.</p>
</td>
  </tr>
</table>

  
  
  



  
</div>


